\(\int \cos (c+d x) (a+i a \tan (c+d x)) \, dx\) [15]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 26 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {i a \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d} \]

[Out]

-I*a*cos(d*x+c)/d+a*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3567, 2717} \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \sin (c+d x)}{d}-\frac {i a \cos (c+d x)}{d} \]

[In]

Int[Cos[c + d*x]*(a + I*a*Tan[c + d*x]),x]

[Out]

((-I)*a*Cos[c + d*x])/d + (a*Sin[c + d*x])/d

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rubi steps \begin{align*} \text {integral}& = -\frac {i a \cos (c+d x)}{d}+a \int \cos (c+d x) \, dx \\ & = -\frac {i a \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.96 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {i a \cos (c) \cos (d x)}{d}+\frac {a \cos (d x) \sin (c)}{d}+\frac {a \cos (c) \sin (d x)}{d}+\frac {i a \sin (c) \sin (d x)}{d} \]

[In]

Integrate[Cos[c + d*x]*(a + I*a*Tan[c + d*x]),x]

[Out]

((-I)*a*Cos[c]*Cos[d*x])/d + (a*Cos[d*x]*Sin[c])/d + (a*Cos[c]*Sin[d*x])/d + (I*a*Sin[c]*Sin[d*x])/d

Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65

method result size
risch \(-\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{d}\) \(17\)
derivativedivides \(\frac {-i a \cos \left (d x +c \right )+a \sin \left (d x +c \right )}{d}\) \(24\)
default \(\frac {-i a \cos \left (d x +c \right )+a \sin \left (d x +c \right )}{d}\) \(24\)

[In]

int(cos(d*x+c)*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-I/d*a*exp(I*(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.58 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {i \, a e^{\left (i \, d x + i \, c\right )}}{d} \]

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

-I*a*e^(I*d*x + I*c)/d

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=\begin {cases} - \frac {i a e^{i c} e^{i d x}}{d} & \text {for}\: d \neq 0 \\a x e^{i c} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise((-I*a*exp(I*c)*exp(I*d*x)/d, Ne(d, 0)), (a*x*exp(I*c), True))

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {-i \, a \cos \left (d x + c\right ) + a \sin \left (d x + c\right )}{d} \]

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

(-I*a*cos(d*x + c) + a*sin(d*x + c))/d

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (24) = 48\).

Time = 0.36 (sec) , antiderivative size = 84, normalized size of antiderivative = 3.23 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {4 i \, a e^{\left (i \, d x + i \, c\right )} + a \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + a \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - a \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - a \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right )}{4 \, d} \]

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(4*I*a*e^(I*d*x + I*c) + a*log(I*e^(I*d*x + I*c) + 1) + a*log(I*e^(I*d*x + I*c) - 1) - a*log(-I*e^(I*d*x
+ I*c) + 1) - a*log(-I*e^(I*d*x + I*c) - 1))/d

Mupad [B] (verification not implemented)

Time = 3.95 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \cos (c+d x) (a+i a \tan (c+d x)) \, dx=\frac {2\,a}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \]

[In]

int(cos(c + d*x)*(a + a*tan(c + d*x)*1i),x)

[Out]

(2*a)/(d*(tan(c/2 + (d*x)/2) + 1i))